package com.lucker.ds.model;

/**
 * recommend_plan
 * @author 
 */
public class RecommendPlan extends BaseValueObject {
    private Long id;

    /**
     * 计划ID
     */
    private String planId;

    /**
     * 计划名称
     */
    private String planName;

    /**
     * 父节点
     */
    private String parentPlan;

    private String caiTypeId;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPlanId() {
        return planId;
    }

    public void setPlanId(String planId) {
        this.planId = planId;
    }

    public String getPlanName() {
        return planName;
    }

    public void setPlanName(String planName) {
        this.planName = planName;
    }

    public String getParentPlan() {
        return parentPlan;
    }

    public void setParentPlan(String parentPlan) {
        this.parentPlan = parentPlan;
    }

    public String getCaiTypeId() {
        return caiTypeId;
    }

    public void setCaiTypeId(String caiTypeId) {
        this.caiTypeId = caiTypeId;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByPlanId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by plan_id asc";
            }else{
                this.orderStr = this.orderStr + ",plan_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by plan_id desc";
            }else{
                this.orderStr = this.orderStr + ",plan_id desc";
            }
        }
    }

    public void orderByPlanName(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by plan_name asc";
            }else{
                this.orderStr = this.orderStr + ",plan_name asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by plan_name desc";
            }else{
                this.orderStr = this.orderStr + ",plan_name desc";
            }
        }
    }

    public void orderByParentPlan(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by parent_plan asc";
            }else{
                this.orderStr = this.orderStr + ",parent_plan asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by parent_plan desc";
            }else{
                this.orderStr = this.orderStr + ",parent_plan desc";
            }
        }
    }

    public void orderByCaiTypeId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by cai_type_id asc";
            }else{
                this.orderStr = this.orderStr + ",cai_type_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by cai_type_id desc";
            }else{
                this.orderStr = this.orderStr + ",cai_type_id desc";
            }
        }
    }
}